1. Field of the Invention
The present invention relates to a device and method for sharing a filter resource, and in particular, to a device and a method for adaptively allocating a number of taps of at least a digital filter based on one or more parameters related to a tap amount.
2. Description of Related Art
A digital filter includes an adder, a multiplexer and/or a delay element, which are different from those of an analog filter such as resistor, capacitor, inductor, etc. Because the adder, the multiplexer and the delay element are insensitive to the temperature, the digital filter is stable against the temperature. Therefore, if parameters of the digital filter are determined appropriately, the digital filter can achieve the desired accuracy and stability.
In general, there are two types of digital filters, one of which is a finite impulse response (hereafter, FIR) filter and the other one is an infinite impulse response (hereafter, IFIR) filter. Taking Nth order FIR filter for example, a relation between an input signal and an output signal can be expressed by the following equation (1) and transfer function (2):y[n]=Σi=0N=bix[n−i]  (1)H[z]=Σn=0Nbnz−n  (2),where x[n−i] denotes the input signal, y[n] denotes the output signal, N is called as the order (generally corresponding to N+1 taps) or the length of the filter, and bi is a coefficient of the filter. H[z] is the function of Z-transform of y[n].
It is well known in this field that the exemplified Nth order FIR filter can be expressed by the block diagram of FIG. 1.
Generally, the higher the order of the FIR filter is, the better the filtering performance is but the higher the cost is.
FIG. 2 is a block diagram showing the configuration of an adaptive FIR filter. It is known that the adaptive filter can self-adjust the coefficients of the filter by a feedback mechanism. As shown in FIG. 2, a correction processor 202 may adjust the coefficients of the FIR filter so as to optimize an output signal û(n), based on a feedback error between the output signal û(n) of an FIR filter 201 and a desired signal u(n) and an input signal x(n)=(u(n)+i(n)) of the FIR filter, wherein i(n) is an interference noise. Therefore, the adaptive FIR filter is usually used for processing a signal with interferences unpredictable in advance.
The finite FIR filters are widely used in many applications. For example, in an application of an Ethernet connection, the FIR filters are used to cancel various interferences. In a case that a plurality of sets of unshielded twisted pairs are used as multi-channel media for the Ethernet connection, when a signal is transmitted in a first channel among the channels, the signal may cause an echo interference to the first channel and cause a near-end cross talk (NEXT) interference to the channels neighboring to the first channel, and the first channel may also be interfered by the NEXT interference from its neighboring channels. In such a case, the FIR filters are used to cancel these interferences and other noise, respectively. Generally, the order (corresponding to number of taps) of a FIR filter is fixed and determined by its application. Therefore, when a same FIR filter is used in various applications, the signal may not be filtered well due to varying factors such as quality of wires, length of the wires or communication environment. In other words, a FIR filter having a fixed and deficient order may not adaptively filter the interferences as the environment gets worse, or a filter designed to have a large order for handling the worst situation may bring a waste. For example, if a first designated FIR filter of M taps is used to cancel the echo interference and a second designated FIR filter of M taps is used to cancel the NEXT interference in a situation that the echo interference is minor and the NEXT interference is severe, the first designated FIR filter only needs a number of taps less than M taps to filter out the echo interference while the second filter needs a number of taps more than M taps to filter out the NEXT interference. This will result in the resource waste in filtering the echo interference and the resource shortage in filtering the NEXT interference.
Therefore, to achieve a better filtering performance under the situation that the filtering resource is constant, a device and a method are required to be able to adaptively allocate filter resources.